//
//  LZZLayerTreeVC.m
//  BKDevMenu
//
//  Created by luzz on 2022/6/2.
//

#import "LZZLayerTreeVC.h"
#import "LZZTreeTableView.h"
#import "LZZLayerTreeManager.h"



@interface LZZLayerTreeVC ()
@property (nonatomic, weak) LZZTreeTableView *tableView;
@end

@implementation LZZLayerTreeVC



- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"App层级视图";
    
    LZZTreeTableView *tableView = [[LZZTreeTableView alloc] initWithFrame:self.view.bounds withData:[[LZZLayerTreeManager shareManager] getCurrentNodes]];
    [self.view addSubview:tableView];
    self.tableView = tableView;
    
    
    UIBarButtonItem * closeBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(closeThisPage)];
    self.navigationItem.rightBarButtonItems = @[closeBtn];
    
    
}
- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    self.tableView.frame = self.view.bounds;
}

- (void)closeThisPage
{
    if (self.hideBlock) {
        self.hideBlock();
    }
}

@end
